package com.lims.admin.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


import javacommon.base.*;

import cn.org.rapid_framework.page.*;

import com.lims.admin.model.*;
import com.lims.admin.dao.*;
import com.lims.admin.vo.query.*;

/**
 * 
 * @author zzh
 *
 */
@Service
@Transactional @SuppressWarnings("unchecked")
public class RoleManager extends BaseManager<Role,java.lang.String>{

	private RoleDao roleDao;
	/**增加setXXXX()方法,spring就可以通过autowire自动设置对象属性,请注意大小写*/
	public void setRoleDao(RoleDao dao) {
		this.roleDao = dao;
	}
	public EntityDao getEntityDao() {
		return this.roleDao;
	}
	
	@Transactional(readOnly=true)
	public Page findPage(RoleQuery query) {
		return roleDao.findPage(query);
	}
	@Transactional(readOnly=true)
	public List<Role> findRolesByIds(String rids) {
		rids = rids.replace(",", "','");
		String hql = "from Role as r where r.objid in('"+rids+"')";
		return roleDao.findByHQL(hql);
	}
	
}
